#include <iostream>
using namespace std;
void sort(int *a, int l){
	int max,ll,times;
	for(int i=0;i<l;i++){
		max = 0;
		times = 0;
		for(int j=1;j<l-i;j++){
			if(a[j] >= a[max]){
				max = j;
				times++;
			}
		}
		if(times != l-i-1){
			ll = a[l-i-1];
			a[l-i-1] = a[max];
			a[max] = ll;
		}
		else break;
	}
}


int getIndx(int i,int j){
	return (i+1)*i/2+j;
}


void make(int *a,int i,int j){
	a[getIndx(i,j)] = a[getIndx(i-1,j-1)]+a[getIndx(i,0)];
}


int find(int *a, int lenth, int k){
	if(a[0] >= k) return a[0];
	if(a[lenth-1] <= k) return a[lenth-1];
	int lf=0,rg=lenth-1;
	while(lf+1<rg){
		int mid = (lf+rg)/2;
		if(k == a[mid]) return a[mid];	
			
		if(k > a[mid]) lf = mid;
		else rg = mid;
	}
	return (k-a[lf] > a[rg]-k?a[rg]:a[lf]);
}



int main(){
	int n,q,k,kk,l;
	cin>>n>>q;
	kk = (1+n)*n/2;
	int m[kk]={0};
	for(int i=0;i<n;i++){
		cin>>m[getIndx(i,0)];
		int j = 1;
		while(j<=i){
			make(m,i,j);
			j++;
		}
	}

	sort(m,kk);
	
	for(int i=0;i<q;i++){
		cin>>k;
		l = k-find(m,kk,k);
		cout<<(l<=0?l*-1:l)<<endl;
	}
}
